public class Sort {
    public static void main(String[] args) {
        //使用冒泡排序
        //对以下数据进行升序排序{9,16,23,25,90}
        int[] nums = {9,16,23,25,90,3,80,33,-11,-33};
        //升序
        for (int i=0;i<nums.length-1;i++){
            for (int j=0;j<nums.length-1-i;j++){
                if(nums[j+1] < nums[j]){
                    int temp = nums[j];
                    nums[j] = nums[j+1];
                    nums[j+1] = temp;
                }
            }
        }
        System.out.print("升序后的结果为：");
        for (int num:nums){
            System.out.print(num+"\t");
        }
        //降序
        for (int i=0;i<nums.length;i++){
            for (int j=0;j<nums.length-1-i;j++){
                if(nums[j] < nums[j+1]){
                    int temp = nums[j];
                    nums[j] = nums[j+1];
                    nums[j+1] = temp;
                }
            }
        }
        System.out.print("\n降序后的结果为：");
        for (int num:nums){
            System.out.print(num+"\t");
        }
        //九九乘法表的输出
        System.out.println("\n九九乘法表的输出：");
        //行
        for (int i=1;i<=9;i++){
            //列
            for (int j=1;j<=i;j++){
                System.out.print(i+"*"+j+"="+i*j+"\t");
            }
            System.out.println();
        }
    }
}
